<!DOCTYPE html>
<html lang="en">
<head>
    [#include "/customer/include/static.htm"]
    <link href="${path}/resources/css/member/main.css" rel="stylesheet" type="text/css" />
    <link href="${path}/resources/css/member/forgot.css" rel="stylesheet" type="text/css" />
    <link href="${path}/resources/plug/layui/css/layui.css" rel="stylesheet" type="text/css"/>
    <script src="${path}/resources/plug/layui/layui.js" type="text/javascript"></script>
</head>

<body>
<!--头部-->
[#include "/customer/include/header.ftl"]
<div class="g-bgwrap">
    <div class="g-subnav-tit">
        <h1><b>你所在的位置：</b><span><a href="/index">我的账户</a></span><i>&gt;</i><a href="">找回交易密码</a></h1>
    </div>
    <div class="forgot-cont">
        <div class="forgot-tit"><b>找回交易密码</b></div>
        <div class="forgot-index">
            <div class="forgot-mobile-tit">请重设您的交易密码</div>
            <div class="forgot-mobile">
                <form class="layui-form">
                    <input type="hidden" name="token" value="${token}" />
                    <ul>
                        <li class="li-inp-lay li-w100">
                            <strong class="i-passwd"></strong>
                            <input type="password" class="inp-txt2 inp-passwd"  required lay-verify="required" id="pass" name="pwd" placeholder="请设置新密码">
                            <a class="i-change-hide" id="show_PassA" title="点我显示隐藏密码"></a>
                        </li>
                        <li class="li-inp-lay li-w100">
                            <strong class="i-passwd"></strong>
                            <input type="password" class="inp-txt2 inp-passwd"  required lay-verify="required"  id="newPass" name="newPwd" placeholder="请确认新密码">
                            <a class="i-change-hide" id="show_PassB" title="点我显示隐藏密码"></a>
                        </li>
                    </ul>
                    <div class="forgot-error" style="display:none;" id="error"></div>
                    <button class="forgot-btn" lay-submit lay-filter="MainForm">提交</button>
                </form>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    layui.use('form', function(){
        var form = layui.form(), $=layui.jquery;
        form.on('submit(MainForm)', function(data){
            if($("#pass").val() != $("#newPass").val()){
                layer.msg("两次密码不一致");
                return false;
            }
            var index = layer.load();
            ajax({
                url: "${path}/member/forget3",
                type: "POST",
                dataType: "json",
                cache: false,
                data: data.field,
                success: function(result) {
                    layer.close(index);
                    if(result && result.type && result.type == "success"){
                        location.href= "${path}/member/forget4?token="+result.content;
                    }else{
                        layer.msg(result.content);
                    }
                },
                complete:function(){
                    layer.close(index);
                }
            });
            return false;
        });
    });
</script>
[#include "/customer/include/footer.ftl"]
</body>
</html>